cmake_minimum_required(VERSION 2.8)

SET(CMAKE_CXX_FLAGS "-std=c++11")
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)

PROJECT(map2d)

# qt5
find_package(Qt5Widgets REQUIRED QUIET)
ADD_DEFINITIONS (${Qt5Widgets_DEFINITIONS})
message("aaaaaaa"${QT_LIBRARIES})

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ADDITIONAL_CFLAGS}")

add_definitions(-DOUT_DIRECTORY="${PROJECT_BINARY_DIR}")
add_definitions(-DSRC_DIRECTORY="${CMAKE_SOURCE_DIR}")

# Set include and link dirs ...
include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/lcmtypes)
link_libraries(/lib/x86_64-linux-gnu/libm.so.6)
link_libraries(/usr/lib/x86_64-linux-gnu/libstdc++.so.6)

file(GLOB project_HEADERS
    *.hpp data_collector/*.h
    data_provider/*.h common/*.h math/*.h tool/*.h
	communication/*.h dock/*.h)
file(GLOB project_SOURCES *.cpp data_collector/*.cpp
        data_provider/*.cpp common/*.cpp math/*.cpp tool/*.cpp
	communication/*.cpp dock/*.cpp)

set(LCM_LIBRARY lcm)

QT5_WRAP_UI(project_FORMS_HEADERS ${project_FORMS})

add_executable(${PROJECT_NAME} ${project_SOURCES} ${project_HEADERS} ${project_FORMS_HEADERS} resources.qrc)

TARGET_LINK_LIBRARIES (${PROJECT_NAME} ${LCM_LIBRARY} ${QT_LIBRARIES} ${GLtest_LIBS} ${FREETYPE_LIBS} ${Boost_LIBS}  dl pthread)
qt5_use_modules(${PROJECT_NAME} Widgets Core Gui)
